package com.bea.ftd.common.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.bea.ftd.common.enums.DateFormatEnum;
import com.bea.ftd.common.intf.IGatewayEntity;
import com.bea.ftd.common.utils.DateUtil;

import lombok.Data;

@Data
@Entity
@Table(name = "sign_info")
public class SignInfo implements IGatewayEntity {

	private static final long serialVersionUID = 5767655241651297259L;

	@Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;

    @Column(name = "partner_code")
    private String partnerCode;

    @Column(name = "sign_id")
    private Long signId;

    @Column(name = "private_key_path")
    private String privateKeyPath;

    @Column(name = "public_key_path")
    private String publicKeyPath;

    @Column(name = "sign_type")
    private String signType;

    @Column(name = "is_activated")
    private Long isActivated;

    @Column(name = "create_time")
    private java.util.Date createTime;

    @Column(name = "update_time")
    private java.util.Date updateTime;
    
	public String getFormatCreateTime() {
		if (null == createTime) {
			return "";
		}
		return DateUtil.formatDate(createTime, DateFormatEnum.YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
	}

	public String getFormatUpdateTime() {
		if (null == updateTime) {
			return "";
		}
		return DateUtil.formatDate(updateTime, DateFormatEnum.YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
	}
}
